package com.steven.io;

import java.io.File;
import java.io.FilenameFilter;

public class FileDemo {
	
	public static void main(String[] args) {
		
		File file = new File("c:/");
		String[] names = file.list(new FilenameFilter() {
			
			@Override
			public boolean accept(File dir, String name) {
				if(name.startsWith("1")){
					return true;
					
				}
				if(name.endsWith(".exe")) return true;
				 
				return false;
			}
		});
		
		for(String name:names){
			System.out.println(name);
			
		}
	}

}
